Ext.define('Admin.view.overtimehistory.OvertimeHistoryGrid', {
    extend: 'Ext.grid.Panel',
    id:'overtimeHistoryGrid',
    xtype:'overtimeHistoryGrid',

    requires: [
        'Ext.button.Segmented',
        'Ext.list.Tree'
    ],
    
    title:'加班申请归档记录',

    layout:'fit',
    defaults:{
    	anchor:'80%'
    },

    
    scrollerble:true,
    bind:'{overtimeHistoryFormLists}',
    columns:[
    	{text:'申请人',dataIndex:'name',width:60,sortable:true},
        {text:'所属部门',dataIndex:'department',width:100,sortable:true},
    	{text:'申请时间',dataIndex:'applicationTime',width:150,sortable:true,renderer:Ext.util.Format.dateRenderer('Y/m/d H:i:s')},
    	{text:'开始时间',dataIndex:'realBeginDate',width:180,sortable:true,renderer:Ext.util.Format.dateRenderer('Y/m/d H:i:s')},
    	{text:'结束时间',dataIndex:'realEndDate',width:180,sortable:true,renderer:Ext.util.Format.dateRenderer('Y/m/d H:i:s')},
    	{text:'加班时长',dataIndex:'realTotalTime',width:75,sortable:true},
    	{text:'加班原因',dataIndex:'reason',sortable:true},
        {text:'状态',dataIndex:'state',sortable:true},
    ],

    dockedItems: {
        xtype: 'toolbar',
        dock: 'top',

        items: [
            {
                xtype: 'textfield',
                fieldLabel: '申请人',
                name: 'name',
                format: 'Y-m-d',
                reference: 'overtimeGridSerchByname',
                listeners:{
                    change:{
                        fn:'overtimeHistoryGridPanelSearch'
                    }
                }
            },{
                id:'department',
                xtype: 'combobox',
                fieldLabel: '所属部门',
                name: 'department',
                displayField: 'name',
                valueField: 'name',
                reference: 'overtimeGridSerchBydepartment',
                store: Ext.create('store.organizationStore'),
                listeners:{
                    change:{
                        fn:'overtimeHistoryGridPanelSearch'
                    }
                }
            },{
                xtype: 'datefield',
                fieldLabel: '申请时间',
                name: 'applicationTime',
                format: 'Y-m-d',
                reference: 'overtimeGridSerchByapplicationTime',
                listeners:{
                    change:{
                        fn:'overtimeHistoryGridPanelSearch'
                    }
                }
            }, 
            {
                text: '清空',
                listeners: {
                    click: 'overtimeHistoryGridPanelclear' //快捷查询按钮
                }
            },
            {
                text: '导出',
                listeners: {
                    click: 'overtimeHistoryGridExport' //快捷查询按钮
                }
            }
               ]
    },
    
    bbar: Ext.create('Ext.PagingToolbar', {
    	bind:'{overtimeHistoryFormLists}',
        displayInfo: true,
        displayMsg: 'Displaying topics {0} - {1} of {2}',
        emptyMsg: "没有任何数据",
        
    })
});